package com.imooc.config.webconfig;

import com.imooc.interceptor.TestInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import javax.annotation.Resource;

/**
 * 配置拦截器注册
 *
 * @author Created By Houce
 * @date 2020-07-16 15:54
 */
@Configuration
public class WebInterceptorConfig extends WebMvcConfigurerAdapter {

    @Resource
    private TestInterceptor testInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(testInterceptor);
    }
}
